from django.shortcuts import render, HttpResponse
from . import models


def test(request):
    print(request.COOKIES)
    print(type(request.COOKIES))
    print(request.path)
    return HttpResponse('test....')


def booklist(request):
    thead = [field.verbose_name for field in models.BookInfo._meta.fields]
    book_query_set = models.BookInfo.objects.all()
    tbody = models.BookInfo.objects.all().values_list()
    context = {
        'thead': thead,
        'tbody': tbody
    }
    return render(request, 'library/booklist.html', context=context)
